def matches(dev, mode) :
    import re
    return (
        re.search("Saitek_ST90_USB_Stick-joystick", dev)
            and
        mode == "fly"
    )

def handler(self, event) :
    import osg
    if event["mode"] == "analog" :
        self.velocity = osg.Matrixd()
        self.velocity.postMult(
            osg.Matrixd.rotate(
                event["data"][0] * self.nav_scale["rotation"],
                0, 0, 1
            )
        )
        self.velocity.postMult(
            osg.Matrixd.translate(
                0, -event["data"][1] * self.nav_scale["translation"][1], 0
            )
        )
